package com.prime.common.model;

import org.apache.ibatis.exceptions.PersistenceException;

import java.util.List;
import java.util.Map;

/**
 * Generic implementation of DAO pattern
 *
 * @author ben
 *
 * @param <T>
 * @param <PK>
 */
public interface IParentDAO<T, PK> {

	public T get(Map<String, ?> parameters);

	public Integer delete(Map<String, ?> parameters);

	// 按条件分页查找
	public List<T> findByWhere(Map<String, ?> parameters);

	// 获取查找的数量
	public Long getCountByWhere(Map<String, ?> parameters);

	// insert an object of type T into the database
	public Integer create(Map<String, Object> obj) throws PersistenceException;

	// update an object of type T
	public Integer update(Map<String, Object> obj) throws PersistenceException;


}